<template>
  <div class="footer-wrap">
    <div class="footer-main">
      <div class="footer-cols">
        <div class="footer-col" v-for="menu in menus" :key="menu.title">
          <div class="footer-title">{{ menu.title }}</div>
          <ul>
            <li v-for="item in menu.items" :key="item.text">
              <a
                @click="handleClick(item.link)"
                :class="item.text === '在线客服' ? 'online-service' : ''"
                ><img
                  v-if="item.text === '在线客服'"
                  src="@/assets/index/kefu.png"
                  alt=""
                  class="online-icon"
                />{{ item.text }}</a
              >
            </li>
          </ul>
        </div>
        <div class="footer-col qrcode-col">
          <div class="qrcode-box">
            <div class="qrcode-img"></div>
            <div class="qrcode-text">平台小程序码</div>
          </div>
        </div>
      </div>
    </div>
    <div class="footer-bottom">
      <div class="footer-bottom-inner">
        <span class="copyright">深圳市中科恩达科技有限公司</span>
        <span>版权所有</span>
        <span class="icp">©2001-2025 | 粤ICP备12345678号-88</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "BaseFooter",
  data() {
    return {
      menus: [
        {
          title: "新手指南",
          items: [
            { text: "注册登录", link: "#" },
            { text: "支付方式", link: "/zhifu" },
            { text: "购买提醒", link: "/tuikuan" },
          ],
        },
        {
          title: "如何上课",
          items: [
            { text: "自学产品", link: "#" },
            { text: "预约飞行", link: "#" },
            { text: "考证指南", link: "#" },
          ],
        },
        {
          title: "关于我们",
          items: [
            { text: "常见问题", link: "#" },
            { text: "关于平台", link: "#" },
            { text: "联系我们", link: "/lianxifangshi" },
          ],
        },
        {
          title: "联系我们",
          items: [
            { text: "服务热线：0755-12345678", link: "#" },
            { text: "服务邮箱：12345678@qq.com", link: "#" },
            { text: "在线客服", link: "#" },
          ],
        },
      ],
    };
  },
  methods: {
    handleClick(link) {
      this.$router.push(link)
    },
  },
};
</script>

<style scoped lang="scss">
.footer-wrap {
  background: #3482f4;
  .footer-main {
    padding: 60px 0 0 0;
    .footer-cols {
      display: flex;
      justify-content: center;
      align-items: flex-start;
      max-width: 1200px;
      margin: 0 auto;
      gap: 0 80px;
    }
    .footer-col {
      // flex: 1;
      // min-width: 160px;
      .footer-title {
        font-weight: 500;
        font-size: 24px;
        margin-bottom: 18px;
        color: #fff;
        text-align: left;
      }
      ul {
        padding: 0;
        margin: 0;
        list-style: none;
        text-align: left;
        li {
          margin-bottom: 12px;
          a {
            font-weight: 400;
            font-size: 20px;
            color: rgba(255, 255, 255, 0.75);
            text-decoration: none;
            transition: color 0.2s;
            &:hover {
              color: #fff;
            }
          }
        }
      }
    }
    .qrcode-col {
      min-width: 200px;
      display: flex;
      flex-direction: column;
      align-items: center;
      .qrcode-box {
        display: flex;
        flex-direction: column;
        align-items: center;
        .qrcode-img {
          width: 100px;
          height: 100px;
          background: #eaeaea;
          border-radius: 8px;
          border: 6px solid #fff;
          margin-bottom: 12px;
        }
        .qrcode-text {
          color: #fff;
          font-size: 16px;
        }
      }
    }
  }
  .footer-bottom {
    margin-top: 40px;
    background: rgba(52, 130, 244, 0.95);
    height: 87px;
    display: flex;
    align-items: center;
    .footer-bottom-inner {
      width: 1200px;
      margin: 0 auto;
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-weight: 400;
      font-size: 15px;
      color: #ffffff;
      .copyright {
        text-align: left;
      }
      .icp {
        text-align: right;
      }
    }
  }
}
.online-service {
  width: 172px;
  height: 40px;
  line-height: 40px;
  border-radius: 6px;
  border: 1px solid #ffffff;
  display: block;
  text-align: center;
}
.online-icon {
  width: 16px;
  margin-right: 10px;
}
</style>
